import 'package:dailoz/data/page_data.dart';
import 'package:dailoz/size_config.dart';
import 'package:dailoz/widgets/bottom_navigator_bar.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  static String id = "home";

  @override
  Widget build(BuildContext context) {
    return const HomeScaffold();
  }
}

class HomeScaffold extends StatelessWidget {
  const HomeScaffold({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    SizeConfig.init(context, 390, 844);
    final provider = Provider.of<PageData>(context);

    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Stack(
        children: [
          provider.list[provider.index],
          Positioned(
            bottom: SizeConfig.getProportionateScreenHeight(30.0),
            child: const BottomNavigatorBar(),
          ),
        ],
      ),
    );
  }
}
